const PASSENGER_FROM = 'AMS'
const PASSENGER_TO = 'CAN'
const PASSENGER_DATE = '20200823'
const PASSENGER_CLASS = ''
const PASSENGER_LASTNAME = 'CHE'
const PASSENGER_FIRSTNAME = 'MUYAO'
const PASSENGER_PASSPORT = 'EE8207661'
const PASSENGER_VALID = '2028-12-20'
const PASSENGER_BIRTHDAY = '1998-09-21'
const PASSENGER_GENDER = 'f'
const PASSENGER_EMAIL = 'test123@qq.com'
const PASSENGER_PHONE1 = '13720004895'
const PASSENGER_PHONE2 = '12301230123'
const PASSENGER_ADDRESS = 'Garden City Street'
const PASSENGER_CITY = 'Amsterdam'
const PASSENGER_POSTCODE = '1071JA'

const AGENT_USERNAME = '318934721395'
const AGENT_PASSWORD = '106234'
const AGENT_PHONE = '12301230123'
const AGENT_EMAIL = 'test321@qq.com'

const SERVER_URL = 'http://http.tiqu.alicdns.com/getip3?num=1&type=2&pro=0&city=0&yys=0&port=1&time=1&ts=1&ys=0&cs=0&lb=1&sb=0&pb=45&mr=1&regions='

const METADATA = `[${PASSENGER_FROM}-${PASSENGER_TO}-${PASSENGER_DATE}:${PASSENGER_LASTNAME}/${PASSENGER_FIRSTNAME}]`

const starting = parseInt(process.argv[4])
const instances = parseInt(process.argv[5])
const apps = [...Array(instances)].map((_, i) => ({
  name: `BOT ${i+starting}`,
  namespace: METADATA,
  script: 'index.js',
  log: `logs/${i+starting}.log`,
  env: {
    METADATA,
    SERVER_URL,
    PASSENGER_FROM,
    PASSENGER_TO,
    PASSENGER_DATE,
    PASSENGER_CLASS,
    PASSENGER_LASTNAME,
    PASSENGER_FIRSTNAME,
    PASSENGER_PASSPORT,
    PASSENGER_VALID,
    PASSENGER_BIRTHDAY,
    PASSENGER_GENDER,
    PASSENGER_EMAIL,
    PASSENGER_PHONE1,
    PASSENGER_PHONE2,
    PASSENGER_ADDRESS,
    PASSENGER_CITY,
    PASSENGER_POSTCODE,
    AGENT_USERNAME,
    AGENT_PASSWORD,
    AGENT_PHONE,
    AGENT_EMAIL,
  }
}))

module.exports = { apps }
